<template>
  <div>
    <van-search
      v-model="value" shape="round" background="#4fc08d" placeholder="请输入搜索关键词" @click="search"    
    />
    <van-tabs v-model="active">
      <van-tab :title="a.name" v-for='a in cate' :key='a.id'>内容 1</van-tab>
    </van-tabs>

    <van-tabbar v-model="active" route>
      <van-tabbar-item icon="wap-home-o" to="/">首页 </van-tabbar-item>
      <van-tabbar-item icon="add-o" to="/MyHeader">发布</van-tabbar-item>
      <van-tabbar-item icon="friends-o" to="/MyFooter">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script scoped>
export default {
  name: "HomePage",
  data() {
    return {
      active:0,
      cate:[]
    }
  },
  created(){
    this.getCate()
  },
  methods: {
    search(){
      this.$router.push('/MySearch')
    },
    getCate(){
      this.$http.get('/api/get_cate_list')
      .then(res=>{
       return  console.log(res.data.data),
       this.cate = res.data.data
      }) 
    }
  },
};
</script>

<style>
*{
  padding: 0;
  margin: 0;
}
p {
  font-size: 5px;
}
.xw {
  border-bottom: 1px solid black;
}
.van-tab{
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
}
.van-tabs van-tabs--line{
  padding-left: 0;
  padding-right: 0;
}
</style>